package cn.biplam.common.tools;

import java.text.DecimalFormat;

import cn.biplam.common.wrapper.ErrorMessage;

/**
 * 度量衡工具类
 */
public abstract class UNIT {
	public static String BYTE="BYTE";
	public static String KB="KB";
	public static String MB="MB";
	public static String GB="GB";
	public static String TB="TB";
	
	/**
	 * 功能 byte转换成Kb
	 * @param l
	 */
	public static String changByteToKb(long lBit) throws ErrorMessage{
		String sReturn="";
		try{
			lBit=lBit>>10;
			DecimalFormat df=new DecimalFormat("#,###,###,###,###,###,###");
			sReturn=df.format(lBit);
		}catch(Exception e){
			throw new ErrorMessage(e);
		}
		return sReturn;
	}

}
